/-app
/-files ...
FileTree.ts
SyncStorageAccess.ts
/-imports
/-storage
/-typings
functions.ts
index.html
try.js
x
    private _getNodeCoreAtIndex(index: number, restPath: string, createIfAbsent: boolean): Node {
1
module teapo.files {
2
  
3
  export class FileTree {
4
    
5
    private _ul: HTMLUListElement;
6
    private _rootNode: Node;
7
​
8
    access: SyncStorageAccess;
9
​
10
    constructor(private _host: HTMLUListElement) {
11
      this._ul = getChildUL(this._host);
12
      // TODO: do something if ul is null
13
​
14
      this._rootNode = new Node(this._ul);
15
    
16
      this.access = {
17
        update: (byFullPath, timestamp) => this._update,
18
        read: (fullPaths) => this._read(fullPaths)
19
      };
20
    }
21
​
22
    private _update(
23
      byFullPath: storage.PropertiesByFullPath,
24
      timestamp: number): void { 
25
    }
26
​
27
    private _read(
28
      fullPaths: string[]): storage.PropertiesByFullPath {
29
      
30
      var result: storage.PropertiesByFullPath = {};
31
​
32
      for (var path in fullPaths) if (fullPaths.hasOwnProperty(path)) {
33
        // TODO: normalize path ?
34
        if (path.charAt(0) !== '/')
35
          path = '/' + path;
36
        
37
        var node = this._rootNode.getNode(path, false);
38
        if (node) {
39
          result
40
        }
41
        
42
      }
43
      
44
      return result;
45
    }
46
​
47
    
48
    
49
  }
50
  
51
  class Node {
52
    
53
    name: string;
54
    fullPath: string;
55
​
56
    private _resolvedUL = false;
57
    private _ul: HTMLUListElement;
58
    private _children: Node[];
59
    private _li: HTMLLIElement;
60
​
61
    constructor(
62
      parentPath: string,
63
      li: HTMLLIElement);
64
    constructor(ul: HTMLUListElement);
65
    constructor (arg1, arg2?) {
33:16